package cn.yxvk.spring.security.oauth2.server.service.impl;

import cn.yxvk.spring.security.oauth2.server.domain.TbUser;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import cn.yxvk.spring.security.oauth2.server.mapper.TbUserMapper;
import cn.yxvk.spring.security.oauth2.server.service.TbUserService;
import tk.mybatis.mapper.entity.Example;

/**
 * @author  yangxiang
 * @date  2019/10/31 10:03
 */
@Service
public class TbUserServiceImpl implements TbUserService{

    @Resource
    private TbUserMapper tbUserMapper;

    @Override
    public TbUser getByUserName(String username) {
        Example example=new Example(TbUser.class);
        example.createCriteria().andEqualTo("username",username);
        return tbUserMapper.selectOneByExample(example);
    }
}
